import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

const api = {
  getGroupList: "/esflow/def/group/getlist"
};

export const getGroupList = () => {
  return http.get<HttpResult, object>(api.getGroupList);
};

export function addOrUpdateObj(params?: object) {
  return http.request<HttpResult>("post", "/esflow/def/insertOrUpdate", {
    data: params
  });
}

/**
 * 根据流程名称获取信息
 *
 * @return AxiosPromise
 */
export function validFlowKey(params?: object) {
  return http.get<HttpResult, object>("/esflow/def/get/valid", params);
}
